import * as actionTypes from '../action/actionTypes'
import Immutable from 'immutable'

// 存储url
export const getUrl = (state = 'bookInfo', action) => {
  switch (action.type) {
    case actionTypes.setUrl:
      return action.data
    default:
      return state
  }
}
// 存储图书信息表格数据
export const getBookInfoTableData = (state = Immutable.fromJS([]), action) => {
  switch (action.type) {
    case actionTypes.bookInfoTableData:
      return action.data
    default:
      return state
  }
}
// 存储借阅记录表格数据
export const getBorrowingRecordTableData = (state = Immutable.fromJS([]), action) => {
  switch (action.type) {
    case actionTypes.borrowingRecordTableData:
      return action.data
    default:
      return state
  }
}
// 我的书友表格数据
export const getMyBookFriendsTableData = (state = Immutable.fromJS([]), action) => {
  switch (action.type) {
    case actionTypes.myBookFriendsTableData:
      return action.data
    default:
      return state
  }
}
// 存储书籍详细信息
export const getBookInfo = (state = Immutable.fromJS({}), action) => {
  switch (action.type) {
    case actionTypes.bookInfo:
      return action.data
    default:
      return state
  }
}
// 存储找书友
export const getBookRecommend = (state = Immutable.fromJS([]), action) => {
  switch (action.type) {
    case actionTypes.bookRecommend:
      return action.data
    default:
      return state
  }
}
// 存储问同学
export const getAskFriend = (state = Immutable.fromJS([]), action) => {
  switch (action.type) {
    case actionTypes.askFriend:
      return action.data
    default:
      return state
  }
}
// 获取内容高度
export const getHeight = (state = Immutable.fromJS(749), action) => {
  switch (action.type) {
    case actionTypes.setHeight:
      return action.data
    default:
      return state
  }
}
// 获取好友消息申请
export const getRequestInfo = (state = Immutable.fromJS([]), action) => {
  switch (action.type) {
    case actionTypes.setRequestInfo:
      return action.data
    default:
      return state
  }
}